﻿<?php
if($this->session->userdata('admin_type') == 'Web Admin')
{
	$this->admin = 'admin';
}
$this->load->view('admin/head'); 
$this->load->view('admin/header');
?>
<style>
.err1{color: red; margin-left: 10px; font-size: 14px; }
</style>
<script type="text/javascript">
	function confirm_alert(node) {
		
	}
</script> 
<!-- Content -->
<div class="space30"></div>
<div class="container">
	<div class="row">
		<div class="col-md-2">
			<nav class="navbar1">
				<?php $this->load->view('admin/left_nav'); ?>
			</nav>
		</div>
		<div class="col-md-10">
        <!--form starts-->
        	<div class="form_container">
            		<h4>Edit Admin</h4>
                    <font color="green"> <?php echo $this->session->userdata('message');  $this->session->unset_userdata('message')?></font>
                    
                    <!--row starts--> 
                    <form action="#" method="post" name="myForm">
                    
                <!--row starts-->
                    	<div class="row1">
                       <div class="form-group col-sm-12">
                        	<label for="fullname2">Full Name <span class="asterisk">*</span></label>
                            <input class="form-control white" required id="fullname2" name="fullname" onBlur="this.value=jQuery.trim(this.value)" type="text" value="<?php if($this->input->post('fullname')) { echo $this->input->post('fullname'); } else { echo $query[0]->admin_fullname; }?>">
                            <span class="err1" ><?php echo form_error('fullname'); ?> </span>	
                        </div>
                        <div class="clearfix"></div>
                    </div>        
                    <!--row closed-->
                     <!--row starts-->
                    	<div class="row1">
                    	<div class="form-group col-sm-12">
                        	<label for="email2">Email<span class="asterisk">*</span></label>
                            <input class="form-control white" required id="email2" name="email" onBlur="this.value=jQuery.trim(this.value)" type="text" value="<?php if($this->input->post('email')) {  echo $this->input->post('email'); } else { echo $query[0]->admin_email;}?>">
                            <span class="err1" ><?php echo form_error('email'); ?> </span>
                        </div>  
                        <div class="clearfix"></div>
                    </div>    
                    <!--row closed-->
                     <!--row starts-->
                    	<div class="row1">
                    	<div class="form-group col-sm-12">
                        	<label for="password2">Password<span class="asterisk">*</span></label>
                            <input class="form-control white"  id="password2" name="password" onBlur="this.value=jQuery.trim(this.value);" onClick="return confirm_alert(this);" type="password" value="">
                             <span class="err1" ><?php echo form_error('password'); ?> </span>
                             <span class="err" >Leave epmty if not updating the password</span>
                        </div>  
                        <div class="clearfix"></div>
                    </div>
                    <!--row closed-->
                     <!--row starts-->
                    	<div class="row1">
                    	<div class="form-group col-sm-12">
                        	<label for="confirm_password2">Confirm Password<span class="asterisk">*</span></label>
                            <input class="form-control white"  id="confirm_password2" name="confirm_password"onBlur="this.value=jQuery.trim(this.value)" type="password" value="">
                            <span class="err1" ><?php echo form_error('confirm_password'); ?> 	</span>
                             <span class="err" >Leave epmty if not updating the password</span>
                        </div>  
                        <div class="clearfix"></div>
                    </div>
                    <!--row closed-->
                     <!--row starts-->
                    	<div class="row1">
                    	<div class="form-group col-sm-12">
                        	<label for="contact_no2">Contact Number</label>
                            <input class="form-control white" id="contact_no2" name="contact_no"onBlur="this.value=jQuery.trim(this.value)" type="text" value="<?php if($this->input->post('contact_no')){  echo $this->input->post('contact_no'); } else { echo $query[0]->admin_contact_number;}?>">
                             <span class="err1" ><?php echo form_error('contact_no'); ?> </span>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <!--row closed-->
                    
                    <!--row starts-->
                    	<div class="row1">
                    	<div class="form-group col-sm-12">
                        	<label for="Remark2">Remark</label>
                            <textarea class="form-control white" id="Remark2" name="Remark" onBlur="this.value=jQuery.trim(this.value)" type="text"><?php if($this->input->post('Remark')) { echo $this->input->post('Remark'); } else { echo $query[0]->admin_remark;} ?></textarea>
                              <span class="err1" ><?php echo form_error('Remark'); ?></span>
                        </div>
                        <div class="clearfix"></div>
                    </div> 
                    <!--row closed-->
                </div>
        <!--form closed-->
         <div class="space30"></div>
         <input type="hidden" name="id" value="<?php echo $query[0]->admin_id;?>"/>
         <input type="submit" name="submit" class="btn btn-primary" value="Update & Continue">
     		</form>
      </div>
       
		<div class="clearfix"></div> 
	</div> 
</div>

<div class="space20"></div>

<div class="space30"></div>

<!-- Content End -->
<?php $this->load->view('common/footer'); ?>